home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
bix02.arc
/
FCOPY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-08-04
|
894b
|
28 lines
{If you find the need from within a Turbo program to copy a file from
one disk to another, here's a Procedure you can use. All it needs are
the names of the files (Source & Dest) as input; you should also
declare the Type STR20 as String[20] somewhere in your program.}
Procedure CopyFile (Source, Dest : Str20);
Const Recsize = 128;
Bufsize = 96;
Var Fin, Fout : File;
RecsRead : Integer;
Buffer : Array [1..Bufsize, 1..Recsize] of Byte;
Begin
Assign (Fin, Source); Assign (Fout, Dest);
Reset (Fin); Rewrite(Fout);
Repeat
BlockRead (Fin, Buffer, Bufsize, RecsRead);
BlockWrite (Fout, Buffer, RecsRead);
Until RecsRead = 0;
Close (Fin); Close (Fout);
End;